package com.hfuuwzy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hfuuwzy.entity.User;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

// 数据库查询接口
@Mapper
public interface UserMapper extends BaseMapper<User> {


//    @Select("select * from sys_user")
//    List<User> findAll();
//
//    @Insert("INSERT into sys_user(username,`password`,nickname,email,phone,address) VALUES " +
//            "(#{username},#{password},#{nickname},#{email},#{phone},#{address})")
//    int insert(User user);
//
//    int update(User user);
//
//    @Delete("delete from sys_user where id = #{id}")
//    Integer deleteById(@Param("id") Integer id);
//
//    @Select("select * from sys_user where username like concat('%',#{username},'%') limit #{pageNum}, #{pageSize}")
//    List<User> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, String username);
//
//    @Select("select count(*) from sys_user where username like concat('%',#{username},'%')")
//    Integer selectTotal(String username);
//
//    @Select("select * from sys_user where email like concat('%',#{email},'%') limit #{pageNum}, #{pageSize}")
//    List<User> selectEmailPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, String email);
//
//    @Select("select count(*) from sys_user where email like concat('%',#{email},'%')")
//    Integer selectEmailTotal(String email);
}
